
/**
 * SimpleClass
 * @param {type} param 
 */
function SimpleClass(param) {
 	
 	var _constructor = function(param) {
 		this.func2();
 	};
 	
 	this.func2 = function () {
 		alert("OK!");
 	};
 	
 	this.constructor = _constructor; 
}

var ttt = new SimpleClass;


//
// Create proper-derivable "class".
//
// Version: 1.2
//

function newClass(parent, prop) {
  // Dynamically create class constructor.
  var clazz = function() {
    // Stupid JS need exactly one "operator new" calling for parent
    // constructor just after class definition.
    if (clazz.preparing) return delete(clazz.preparing);
    // Call custom constructor.
    if (clazz.constr) {
this.constructor = clazz; // we need it!
clazz.constr.apply(this, arguments);
    }
  };
  clazz.prototype = {}; // no prototype by default
  if (parent) {
    parent.preparing = true;
    clazz.prototype = new parent;
    clazz.prototype.constructor = parent;
    clazz.constr = parent; // BY DEFAULT - parent constructor
  }
  if (prop) {
    var cname = "constructor";
    for (var k in prop) {
if (k != cname) clazz.prototype[k] = prop[k];
    }
    if (prop[cname] && prop[cname] != Object)
clazz.constr = prop[cname];
  }
  return clazz;
}